package com.ruoyi.orderReturn.service.impl;

import java.util.List;

import com.ruoyi.orderReturn.domain.VO.OrderUserReason;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.orderReturn.mapper.OrderReturnMapper;
import com.ruoyi.orderReturn.domain.OrderReturn;
import com.ruoyi.orderReturn.service.IOrderReturnService;

/**
 * 商品退货Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-17
 */
@Service
public class OrderReturnServiceImpl implements IOrderReturnService
{
    @Autowired
    private OrderReturnMapper orderReturnMapper;

    /**
     * 查询商品退货
     *
     * @param returnId 商品退货主键
     * @return 商品退货
     */
    @Override
    public OrderReturn selectOrderReturnByReturnId(Long returnId)
    {
        return orderReturnMapper.selectOrderReturnByReturnId(returnId);
    }

    /**
     * 查询商品退货列表
     *
     * @param orderReturn 商品退货
     * @return 商品退货
     */
    @Override
    public List<OrderReturn> selectOrderReturnList(OrderUserReason orderReturn)
    {
        return orderReturnMapper.selectOrderReturnList(orderReturn);
    }

    /**
     * 新增商品退货
     *
     * @param orderReturn 商品退货
     * @return 结果
     */
    @Override
    public int insertOrderReturn(OrderReturn orderReturn)
    {
        return orderReturnMapper.insertOrderReturn(orderReturn);
    }

    /**
     * 修改商品退货
     *
     * @param orderReturn 商品退货
     * @return 结果
     */
    @Override
    public int updateOrderReturn(OrderReturn orderReturn)
    {
        return orderReturnMapper.updateOrderReturn(orderReturn);
    }

    /**
     * 批量删除商品退货
     *
     * @param returnIds 需要删除的商品退货主键
     * @return 结果
     */
    @Override
    public int deleteOrderReturnByReturnIds(Long[] returnIds)
    {
        return orderReturnMapper.deleteOrderReturnByReturnIds(returnIds);
    }

    /**
     * 删除商品退货信息
     *
     * @param returnId 商品退货主键
     * @return 结果
     */
    @Override
    public int deleteOrderReturnByReturnId(Long returnId)
    {
        return orderReturnMapper.deleteOrderReturnByReturnId(returnId);
    }

    @Override
    public List<OrderReturn> orderReturnList() {
        return  orderReturnMapper.orderReturnList();
    }
}
